import type { RouteObject } from "react-router-dom"
import { useRoutes } from "react-router-dom"

const routes: RouteObject[] = []

const modules = import.meta.glob<any>('./modules/*.tsx', { eager: true })
for (const path in modules) {
  if (Array.isArray(modules[path].default)) {
    modules[path].default.map((v: any) => routes.push(v))
  } else {
    routes.push(modules[path].default)
  }
}



function Page() {
  return (
    <>
      {useRoutes(routes)}
    </>
  )
}

export default Page
